﻿using FirstDemo.Models;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;

// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace FirstDemo.Controllers
{
    [Route("api/[controller]")]
    public class ApiController : Controller
    {
        /// <summary>
        /// API总览
        /// </summary>
        /// <returns></returns>
        [HttpGet("/api")]
        public string Get()
        {
            Response.StatusCode = 200;
            return JsonConvert.SerializeObject(new AllUrl());    //Json序列化就是将传输的对象序列化为二进制的数据流，字节序列；反序列化就是将数据流转换为对象
        }
    }
}
